{% extends 'layout.html' %}
{% load static %}

{% block content %}
    <div class="container-fluid" style="margin-top: 20px;">

        <div class="col-md-12">
            <div class="panel panel-info mystyle-panel">
                <div class="panel-heading">
                    权限列表
                    {% csrf_token %}
                    <a class="pull-right btn btn-success" href="{% url 'permission_add' %}"
                       style="margin-top: -8px">添加权限</a>
                </div>
                <div class="panel-body">
                    <table class="table table-bordered">
                        <thead>
                        <tr class="success">
                            <th>序号</th>
                            <th>ID</th>
                            <th>权限URL</th>
                            <th>权限信息</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        {% if not permission_list %}
                            <tr>
                                    <td colspan="5">无权限</td>
                                </tr>
                        {% else %}
                            {% for permission in permission_list %}
                                <tr>
                                    <td>{{ forloop.counter }}</td>
                                    <td>{{ permission.pk }}</td>
                                    <td>{{ permission.url }}</td>
                                    <td>{{ permission.title }}</td>
                                    <td>
                                        <a href="{% url 'permission_edit' permission.pk %}"><i
                                                class="fa fa-edit fa-fw fa-lg"></i></a>
                                        <a style="color:red;"><i class="fa fa-trash-o fa-fw fa-lg"
                                                                 url="{% url 'permission_del' permission.pk %}"></i></a>
                                    </td>
                                </tr>
                            {% endfor %}
                        {% endif %}


                        </tbody>
                    </table>
                    {{ page_html }}
                </div>
            </div>
        </div>
    </div>
{% endblock content %}